import request from '../request/request.ts'

//创建队伍api
export const addTeam =  (data:any) =>  {
    return request({
        url: '/service/team/add',
        method: 'post',
        data: data
    });
}

//获取队伍信息（查询/分页）
export const getTeamInfoAndSearch =  (data:any) =>  {
    return request({
        url: '/service/team/searchTeamAndUserByPage',
        method: 'post',
        data: data
    });
}

//获取自己创建的队伍信息
export const getTeamCreate =  () =>  {
    return request({
        url: '/service/team/my/create',
        method: 'get'
    });
}

//获取自己加入的队伍信息（包含创建）
export const getTeamJoin =  () =>  {
    return request({
        url: '/service/team/my/join',
        method: 'get'
    });
}

//退出队伍请求
export const quitTeam =  (data:any) =>  {
    return request({
        url: '/service/team/quit',
        method: 'delete',
        data: data
    });
}

//解散队伍请求
export const dissolutionTeam =  (teamId:any) =>  {
    return request({
        url: '/service/team/dissolution',
        method: 'delete',
        params:{
            teamId:teamId
        }
    });
}


//修改队伍请求
export const updateTeam =  (data:any) =>  {
    return request({
        url: '/service/team/update',
        method: 'put',
        data: data
    });
}

//加入队伍请求
export const joinTeam =  (data:any) =>  {
    return request({
        url: '/service/team/join',
        method: 'post',
        data: data
    });
}

//加入队伍请求
export const joinTeamInvite =  (teamId:any) =>  {
    return request({
        url: '/service/team/joinInvite',
        method: 'get',
        params: {
            teamId: teamId
        }
    });
}


//查询某个队伍的信息
export const selectOneTeam = (data:any) =>{
    return request({
        url: '/service/team/selectOneTeam',
        method: 'post',
        data: data
    });
}


//邀请加入队伍请求
export const inviteJoinTeam = (data:any) =>{
    return request({
        url: '/service/team/invite',
        method: 'post',
        data: data
    });
}

